1. Technical Field
The present invention relates to data-processing systems, and in particular to the determination of performance characteristics of a cache design. Still more particularly, the present invention relates to a method and system for the determination of performance characteristics of a cache design by simulating cache operations utilizing an output trace of a cache.
2. Description of the Related Art
Data-processing systems include at least one processor which is coupled to a main memory device utilizing a bus. Information and data is transmitted between processors and the memory device utilizing the bus. In most systems, a cache is included in order to increase the rate the information and data is processed by the processors.
A cache is a special-purpose storage buffer associated with a processor which is typically smaller and faster than the main memory, and is used to hold a copy of information, such as instructions and data. Information is included in the main memory with a copy of the information being included within a cache. Optimally, the instructions and data included within the cache are the instructions and data most likely to be next requested by the processor. In multi-processor systems, each processor typically has its own cache.
When a processor needs information, it first will look for that information in the processor's cache. The information will include a reference to main memory. The reference is utilized to determine what data is needed from the main memory. The reference will include at least the address of the data to be retrieved and the request type. The reference is first utilized to determine if the information is located in the cache. If the information is not located in the cache, the processor then must retrieve the information from main memory. Because a cache is faster than main memory, information can be retrieved from a cache much faster than it can be retrieved from main memory.
Cache simulation is used to predict how well a cache design will perform. Current cache simulation is a two-step process. The first step is to capture a trace of activity from a processor to its cache. In order to capture a trace of all inputs to a cache, there must be access to the cache input. The trace will include a copy of all activity for a period of time. All references input into a cache during the period of time are captured and stored in the trace. Once a trace is completed, the trace is used as an input to a cache simulator. The cache simulator simulates the response of a particular cache design.
The cache simulator counts particular events which occur during the simulation. These counts are then combined with other statistics to produce information which indicates the performance of the cache design. For example, the number of cache misses per reference, the number of writebacks per reference, the number of snoop hits, and snoop hits to a modified cache line are important statistics to monitor.
In some systems, there are several cache buffers. A smaller cache may be first accessed by the processor. If the information is not located in the smaller cache, a second cache is accessed. Finally, if the information is not located in a second cache, main memory is accessed to retrieve the information. For systems having several levels of cache systems, it may not be possible to obtain a trace of the inputs to a cache. There may be no access to the inputs of one or more of the cache systems.
Another problem arises in current systems because a cache may be imbedded within the same integrated circuit which includes the processor. In these systems, there is no external access to the inputs of the cache.
Capturing a representative trace may also become a problem. Many millions of references are needed to simulate large cache sizes. Traces are limited in capacity by the capabilities of how they are captured and stored. Because the tools utilized to capture and store traces have a maximum capacity, there is a maximum number of references that can be captured and stored in a single trace. The longer the period of time a trace captures information, the more representative it is of the data-processing system being traced and the better it is for simulation. To simulate larger caches, longer traces are needed. Representative traces may require more references than can be captured or stored.
Therefore a need exists for a method and system for determining performance characteristics of a cache design utilizing the output of a cache in a data-processing system.